/**
 * Created by kangdaye on 16/6/13.
 */
app.factory('goodsListCache', function() {
    return{
        listTab : [
            {name : '所有商品'},
            {id : 1,name : '销售中'},
            {id : 2,name : '已下架'}
        ],
        listTableHeader : [
            {displayName:'ID', field: 'id', width:'5%'},
            {displayName:'商品名称', width:'35%',cellTemplate:'<div class="lh-20"><img class="f-l" width="60" ng-src="{{row.image}}"><p style="padding-left: 70px;">{{row.title}}</p></div>'},
            {displayName:'售价', width:'15%',cellTemplate:'<div class="lh-20">' +
                '<div ng-if="row.price < row.originPrice"><s class="d-b" style="color: #999;">原价:¥{{row.originPrice}}</s><p style="color: #000;">现价:¥{{row.price}}</p></div>' +
                '<div ng-if="row.price == row.originPrice">¥{{row.price}}</div>' +
            '</div>'},
            {displayName:'库存', field: 'inventory',width:'10%'},
            {displayName:'重量', width:'10%',cellTemplate:'<div>{{row.productParams.weight}}kg</div>'},
            {displayName:'状态', width:'10%',cellTemplate:'<div ng-class="{\'cor-green\' : row.shelves === true}">{{row.shelves ? row.promotion ? "已促销" : "销售中" : "未上架"}}</div>'},
            {displayName:'操作', field: 'title9',width:'15%',cellTemplate:'<div class="operation">' +
                '<a href="{{$root.prefix}}goods/goodsList/aEGoods.html&{{row.id}}">编辑</a>' +
                '<a ng-click="evt.entity.batDetele(row.id)" class="ml-10 mr-10">删除</a>' +
                '<a ng-click="evt.entity.batShelves(!row.shelves,row.id)">{{row.shelves ? "下架" : "上架"}}</a>' +
            '</div>'
            }
        ],
        category : [
            {id : 101,name : '大米杂粮'},
            {id : 102,name : '各地特产'},
            {id : 103,name : '手作食材'},
            {id : 104,name : '时令水果'},
            {id : 105,name : '特价促销'}
        ],
        promotionType : [
            {id : 'single:discount',name : '打折促销'},
            {id : 'single:depreciate',name : '降价促销'}
        ]
    }
});
